home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / kms20.lha / KMS / KMS-Install < prev    next >
Text File  |  1995-09-24  |  19KB  |  744 lines

  1. ; $VER: KMS 2.0
  2. ; Copyright ©1993-95 Thomas Schwarz - All Rights Reserved
  3.  
  4. (complete 0)
  5.  
  6. (onerror
  7.    (if
  8.       (> @ioerr 0)
  9.       (message
  10.          "Error code: " @ioerr "\n"
  11.          "\n"
  12.          "Some error has occurred. Please inform the author "
  13.          "of KMS by email to kmshq@ruatha.muc.de\n"
  14.          "\n"
  15.          "The following information is required: error code "
  16.          "(above), last error message, the percentage done "
  17.          "(window title) and your log file. Thank you!"
  18.       )
  19.    )
  20. )
  21.  
  22. (set @default-dest "SYS:")
  23.  
  24. ; **************************************************************************
  25.  
  26. (if
  27.    (< (/ (getversion) 65536) 37)
  28.    (
  29.    (message "Sorry, this package requires OS v2.04 or better.")
  30.    (exit (quiet))
  31.    )
  32. )
  33.  
  34. ; **************************************************************************
  35.  
  36. (if
  37.    (exists "KMS:" (noreq))
  38.    (set update 
  39.       (askchoice
  40.          (prompt "KMS: assign detected...")
  41.          (help
  42.             "If you decide for updating your old installation "
  43.             "you won't be asked for directories. Directories "
  44.             "of your previous installation will be used. You "
  45.             "will get the opportunity to make a backup of "
  46.             "your current KMS installation in this case, too.\n"
  47.             "\n"
  48.             "If you decide for removing your current KMS "
  49.             "installation this script will try to delete "
  50.             "files introduced by a former KMS installation. "
  51.             "However, this utility is not able to remove all "
  52.             "files related to KMS. For example it won't "
  53.             "remove the KMSAUX: related files because they "
  54.             "might be used by other applications, too. It "
  55.             "won't remove the KMS related entries in your "
  56.             "ums.config either because it isn't able to do so.\n"
  57.             "\n"
  58.             "If you ever run into troubles related to this "
  59.             "install script (which certainly is not perfect), "
  60.             "remove your outdated KMS copy (use the 'Deinstall' "
  61.             "option) before attempting a completely new installation."
  62.          )
  63.          (default 1)
  64.          (choices
  65.             "Install KMS from scratch"
  66.             "Update existing KMS installation"
  67.             "Deinstall KMS"
  68.          )
  69.       )
  70.    )
  71.    (set update 0)
  72. )
  73.  
  74. (complete 1)
  75.  
  76. ; **************************************************************************
  77. ; update = 0 : Neuinstallation
  78. ; **************************************************************************
  79.  
  80. (if
  81.    (= update 0)
  82.    (
  83.    (set kmsdest
  84.       (askdir
  85.          (prompt "Please select the drawer you want KMS to be installed in. A new drawer \"KMS\" will be created therein.")
  86.          (default @default-dest)
  87.          (help @askdir-help)
  88.       )
  89.    )
  90.  
  91.    (set kmsdest (tackon kmsdest "KMS"))
  92.    (makedir kmsdest (infos))
  93.    (set @default-dest kmsdest)
  94.    (makeassign "KMS" kmsdest)
  95.  
  96.    (set targetsize (getdiskspace kmsdest))
  97.    (if
  98.       (< targetsize 1500000)
  99.       (if
  100.          (<> (getdevice kmsdest) "RAM")
  101.          (abort
  102.             "This installation requires about 1.5 MB free "
  103.             "on the volume where you wish to install KMS. "
  104.             "Please make this space available and then try again."
  105.          )
  106.       )
  107.    )
  108.  
  109.    (complete 5)
  110.  
  111.    (copyfiles
  112.       (prompt "Copying Binaries...")
  113.       (source "Bin")
  114.       (dest "KMS:Bin")
  115.       (help @copyfiles-help)
  116.       (infos)
  117.       (all)
  118.    )
  119.  
  120.    (complete 15)
  121.  
  122.    (copyfiles
  123.       (prompt "Copying Data Files...")
  124.       (source "Data")
  125.       (dest "KMS:Data")
  126.       (help @copyfiles-help)
  127.       (all)
  128.    )
  129.  
  130.    (complete 25)
  131.  
  132.    (copyfiles
  133.       (prompt "Copying Documentation...")
  134.       (source "Doc")
  135.       (dest "KMS:Doc")
  136.       (help @copyfiles-help)
  137.       (infos)
  138.       (all)
  139.    )
  140.  
  141.    (complete 35)
  142.  
  143.    (copyfiles
  144.       (prompt "Copying Text Files...")
  145.       (source "Text")
  146.       (help @copyfiles-help)
  147.       (dest "KMS:Text")
  148.       (all)
  149.    )
  150.  
  151.    (complete 50)
  152.  
  153.    (copyfiles
  154.       (prompt "Copying ARexx Files...")
  155.       (source "Rexx")
  156.       (dest "KMS:Rexx")
  157.       (help @copyfiles-help)
  158.       (all)
  159.    )
  160.  
  161.    (complete 55)
  162.  
  163.    (copyfiles
  164.       (prompt "Copying User Files...")
  165.       (source "User")
  166.       (dest "KMS:User")
  167.       (help @copyfiles-help)
  168.       (all)
  169.    )
  170.  
  171.    (complete 60)
  172.  
  173.    (copyfiles
  174.       (prompt "Copying Doors Files...")
  175.       (source "Doors")
  176.       (dest "KMS:Doors")
  177.       (help @copyfiles-help)
  178.       (all)
  179.    )
  180.    
  181.    (complete 65)
  182.  
  183.    (copyfiles
  184.       (prompt "Copying Misc Files...")
  185.       (source "")
  186.       (dest "KMS:")
  187.       (pattern "~(#?Install#?|Devs#?)")
  188.       (help @copyfiles-help)
  189.       (files)
  190.       (infos)
  191.    )
  192.  
  193.    (delete
  194.       "KMS:Devs.info"
  195.       (help
  196.          "This file is junk."
  197.       )
  198.       (optional "force")
  199.    )
  200.  
  201.    (copyfiles
  202.       (prompt "Copying /KMS.info...")
  203.       (source "/KMS.info")
  204.       (dest "KMS:/")
  205.       (help @copyfiles-help)
  206.       (infos)
  207.    )
  208.  
  209.    (complete 70)
  210.  
  211.    (set umsbase (getenv "UMSMB.default"))
  212.    (if (= umsbase "")
  213.       (set umsbase "SYS:")
  214.    )
  215.  
  216.    (set doit
  217.       (askbool
  218.          (prompt "May I append the necessary config entries to your ums.config?")
  219.          (help
  220.             "KMS needs configuration entries in your ums.config. If you didn't "
  221.             "already insert the necessary entries by yourself, you have to let "
  222.             "me do this now in order to get a working KMS installation."
  223.          )
  224.       )
  225.    )
  226.  
  227.    (if doit
  228.       (
  229.       (set umsbase
  230.          (askdir
  231.             (prompt "In which directory is your ums.config please?")
  232.             (default umsbase)
  233.             (help 
  234.                "Your ums.config resides in your UMS messagebase directory. "
  235.                "So please just tell me the name of this directory.\n"
  236.                "\n"
  237.                @askdir-help
  238.             )
  239.          )
  240.       )
  241.       (rename 
  242.          (tackon umsbase "ums.config")
  243.          (tackon umsbase "ums.config.old")
  244.          (prompt "Renaming original ums.config...")
  245.          (help "Your original ums.config will be renamed to \"ums.config.old\" with your friendly permission...")
  246.       )
  247.       (textfile
  248.          (prompt "Creating new ums.config...")
  249.          (dest (tackon umsbase "ums.config"))
  250.          (include (tackon umsbase "ums.config.old"))
  251.          (include "Doc/KMS_UMS.config")
  252.          (help
  253.             "Why can't you simply let me do my work, eh? :-> "
  254.             "You seem to be very curious but anyhow why shouldn't I tell you: "
  255.             "I'm creating a new ums.config with the KMS related entries appended now..."
  256.          )
  257.       )
  258.       )
  259.    )
  260.  
  261.    (complete 80)
  262.  
  263.    (if
  264.       (exists "DEVS:DosDrivers" (noreq))
  265.       (copyfiles
  266.          (prompt "Copying DosDrivers...")
  267.          (source "Devs/DosDrivers")
  268.          (dest "DEVS:DosDrivers")
  269.          (help
  270.             "I'm now copying the KMSAUX: mountlist entry into your "
  271.             "\"DEVS:DosDrivers\" directory with your friendly permission...\n"
  272.             "\n"
  273.             @copyfiles-help
  274.          )
  275.          (infos)
  276.          (all)
  277.       )
  278.       (
  279.       (rename
  280.          ("DEVS:MountList")
  281.          ("DEVS:MountList.old")
  282.          (prompt "Renaming original DEVS:MountList...")
  283.          (help "Your original MountList will be renamed to \"MountList.old\" with your friendly permission...")
  284.       )
  285.       (textfile
  286.          (prompt "Adding entry to DEVS:MountList...")
  287.          (dest "DEVS:MountList")
  288.          (include "DEVS:MountList.old")
  289.          (append "KMSAUX:")
  290.          (include "Devs/DosDrivers/KMSAUX")
  291.          (append "#")
  292.          (help
  293.             "Why can't you simply let me do my work, eh? :-] "
  294.             "You seem to be very curious but anyhow why shouldn't I tell you: "
  295.             "I'm adding an entry for KMSAUX: to your DEVS:MountList..."
  296.          )
  297.       )
  298.       )
  299.    )
  300.    (copylib
  301.       (prompt "Copying KMSAUX-Handler...")
  302.       (source "l/KMSAUX-Handler")
  303.       (dest "L:")
  304.       (help
  305.          "KMSAUX needs this handler to be copied to your \"L:\" directory.\n"
  306.          "\n"
  307.          @copylib-help
  308.       )
  309.    )
  310.    (if
  311.       (NOT (exists "DEVS:DosDrivers" (noreq)))
  312.       (startup "KMSAUX"
  313.          (prompt "Adding \"Mount KMSAUX:\" statement to your user-startup...")
  314.          (command "Mount KMSAUX:")
  315.          (help
  316.             "You will need to execute this statement before being able to use "
  317.             "the KMSAUX: device.\n"
  318.             "\n"
  319.             @startup-help
  320.          )
  321.       )
  322.    )
  323.  
  324.    (complete 95)
  325.  
  326.    (startup "KMS"
  327.       (prompt "Adding a \"KMS:\" Assignment statement to your user-startup...")
  328.       (command "Assign KMS: \"" kmsdest "\"")
  329.       (help 
  330.          "You'll need this, if you want to use the default KMS configuration "
  331.          "and/or let KMS-Install do updates to the actual version from an older one. "
  332.          "If you edit the KMS related entries in ums.config not to use \"KMS:\", "
  333.          "then you may skip this part. In this case you also have to install KMS "
  334.          "from scratch for each update.\n"
  335.          "\n"
  336.          @startup-help
  337.       )
  338.    )
  339.  
  340.    (complete 100)
  341.  
  342.    (exit)
  343.    )
  344. )
  345.  
  346. ; **************************************************************************
  347. ; update = 1 : Update KMS Installation
  348. ; **************************************************************************
  349.  
  350. (if (= update 1)
  351.    (
  352.    (if
  353.       (NOT (exists "KMS:" (noreq)))
  354.       (exit (quiet))
  355.    )
  356.  
  357.    (if
  358.       (= (getversion "KMS:Bin/KMSPort") (getversion "Bin/KMSPort"))
  359.       (
  360.       (complete 100)
  361.  
  362.       (abort "Your KMS installation is up-to-date!")
  363.       )
  364.    )
  365.    (if
  366.       (> (getversion "KMS:Bin/KMSPort") (getversion "Bin/KMSPort"))
  367.       (
  368.       (complete 100)
  369.  
  370.       (abort "Degrading? Are you kidding? :-)")
  371.       )
  372.    )
  373.  
  374.    (set vernum (getversion "Bin/KMSPort"))
  375.    (set kmsver (/ vernum 65536))
  376.    (set kmsrev (- vernum (* kmsver 65536)))
  377.    (set vernum (getversion "KMS:Bin/KMSPort"))
  378.    (set oldkmsver (/ vernum 65536))
  379.    (set oldkmsrev (- vernum (* kmsver 65536)))
  380.  
  381.    (complete 5)
  382.  
  383.    (message ("You're about to update\nfrom KMS V%ld.%ld to KMS V%ld.%ld..." oldkmsver oldkmsrev kmsver kmsrev))
  384.  
  385.    (set kmsdest (getassign "KMS"))
  386.    (set @default-dest kmsdest)
  387.  
  388.    (set doit
  389.       (askbool
  390.          (prompt "Do you want to backup your current KMS installation?")
  391.          (help 
  392.             "In the case you have made many changes to your KMS related "
  393.             "text and data files, I recommend you to do the backup for being "
  394.             "able to refer to them afterwards for reconfiguring the new version. "
  395.             "Otherwise all your changes will be lost after updating.\n"
  396.             "\n"
  397.             "For information about which of your old files may be reused "
  398.             "in the new version, please refer to the \"Version.dok\" file "
  399.             "supplied in the documentation directory. Thank you."
  400.          )
  401.       )
  402.    )
  403.  
  404.    (if doit
  405.       (
  406.       (if
  407.          (NOT (exists "KMS:/KMSBackup" (noreq)))
  408.          (makedir "KMS:/KMSBackup" (infos))
  409.       )
  410.       
  411.       (working "Copying KMS: directory to KMS:/KMSBackup...")
  412.  
  413.       (run "Copy KMS: KMS:/KMSBackup ALL CLONE QUIET")
  414.       )
  415.    )
  416.  
  417.    (complete 10)
  418.  
  419.    (if
  420.       (= oldkmsrev 80)
  421.       
  422.       ; Special work to be done for updating from KMS 1.80b
  423.  
  424.       (if
  425.          (exists "KMS:Data/KMS_AREAS.DAT" (noreq))
  426.          (
  427.          (rename
  428.             ("KMS:Data/KMS_AREAS.DAT")
  429.             ("KMS:Data/KMS_AREAS.OLD")
  430.             (help "Your original area data file will be renamed to \"KMS_AREAS.OLD\"...")
  431.          )
  432.          (run "Bin/KMSConv -a KMS:Data/KMS_AREAS.OLD KMS:Data/KMS_AREAS.DAT")
  433.          (message
  434.             "Your area data file was converted into the new format. Your old "
  435.             "\"KMS_AREAS.DAT\" was renamed to \"KMS_AREAS.OLD\"."
  436.          )
  437.          )
  438.       )
  439.    )
  440.  
  441.    (foreach
  442.       "Bin"
  443.       "#?"
  444.       (copylib
  445.          (prompt "Updating Binaries...")
  446.          (source (tackon "Bin" @each-name))
  447.          (dest "KMS:Bin")
  448.          (help @copylib-help)
  449.          (infos)
  450.       )
  451.    )
  452.  
  453.    (complete 20)
  454.  
  455.    (copyfiles
  456.       (prompt "Updating Data Files...")
  457.       (source "Data")
  458.       (dest "KMS:Data")
  459.       (help
  460.          "You may choose files not to be copied here, if you know what you "
  461.          "are doing...\nPlease refer to \"Version.dok\" for information about "
  462.          "reuseable files.\n"
  463.          "\n"
  464.          @copyfiles-help
  465.       )
  466.       (confirm)
  467.       (all)
  468.    )
  469.  
  470.    (complete 30)
  471.  
  472.    (copyfiles
  473.       (prompt "Updating Documentation...")
  474.       (source "Doc")
  475.       (dest "KMS:Doc")
  476.       (infos)
  477.       (help @copyfiles-help)
  478.       (all)
  479.    )
  480.  
  481.    (complete 50)
  482.  
  483.    (copyfiles
  484.       (prompt "Updating Text...")
  485.       (source "Text")
  486.       (dest "KMS:Text")
  487.       (help
  488.          "You may choose files not to be copied here, if you know what you "
  489.          "are doing...\nPlease refer to \"Version.dok\" for information about "
  490.          "reuseable files.\n"
  491.          "\n"
  492.          @copyfiles-help
  493.       )
  494.       (confirm)
  495.       (all)
  496.    )
  497.  
  498.    (complete 70)
  499.  
  500.    (copyfiles
  501.       (prompt "Updating ARexx Files...")
  502.       (source "Rexx")
  503.       (dest "KMS:Rexx")
  504.       (help
  505.          "You may choose files not to be copied here, if you know what you "
  506.          "are doing...\nPlease refer to \"Version.dok\" for information about "
  507.          "reuseable files.\n"
  508.          "\n"
  509.          @copyfiles-help
  510.       )
  511.       (confirm)
  512.       (all)
  513.    )
  514.  
  515.    (complete 75)
  516.  
  517.    (copyfiles
  518.       (prompt "Updating User Files...")
  519.       (source "User")
  520.       (dest "KMS:User")
  521.       (help
  522.          "You may choose files not to be copied here, if you know what you "
  523.          "are doing...\nPlease refer to \"Version.dok\" for information about "
  524.          "reuseable files.\n"
  525.          "\n"
  526.          @copyfiles-help
  527.       )
  528.       (confirm)
  529.       (all)
  530.    )
  531.  
  532.    (complete 80)
  533.  
  534.    (copyfiles
  535.       (prompt "Updating Doors Files...")
  536.       (source "Doors")
  537.       (dest "KMS:Doors")
  538.       (help
  539.          "You may choose files not to be copied here, if you know what you "
  540.          "are doing...\nPlease refer to \"Version.dok\" for information about "
  541.          "reuseable files.\n"
  542.          "\n"
  543.          @copyfiles-help
  544.       )
  545.       (confirm)
  546.       (all)
  547.    )
  548.  
  549.    (complete 85)
  550.  
  551.    (copylib
  552.       (prompt "Updating KMSAUX-Handler...")
  553.       (source "l/KMSAUX-Handler")
  554.       (dest "L:")
  555.       (help
  556.          "You really should update your KMSAUX-Handler if necessary!\n"
  557.          "\n"
  558.          @copylib-help
  559.       )
  560.    )
  561.  
  562.    (copyfiles
  563.       (prompt "Updating Misc Files...")
  564.       (source "")
  565.       (dest "KMS:")
  566.       (pattern "~(#?Install#?|Devs#?)")
  567.       (files)
  568.       (infos)
  569.    )
  570.  
  571.    (delete
  572.       "KMS:Devs.info"
  573.       (help
  574.          "This file is junk."
  575.       )
  576.       (optional "force")
  577.    )
  578.  
  579.    (complete 90)
  580.  
  581.    (if
  582.       (< oldkmsrev 85)
  583.       (
  584.       ; Special work to be done for updating from before KMS 1.85b
  585.  
  586.       (if
  587.          (exists "DEVS:DosDrivers" (noreq))
  588.          (copyfiles
  589.             (prompt "Copying DosDrivers...")
  590.             (source "Devs/DosDrivers")
  591.             (dest "DEVS:DosDrivers")
  592.             (help
  593.                "I'm now copying the KMSAUX: mountlist entry into your "
  594.                "\"DEVS:DosDrivers\" directory with your friendly permission...\n"
  595.                "\n"
  596.                @copyfiles-help
  597.             )
  598.             (infos)
  599.             (all)
  600.          )
  601.          (
  602.          (rename
  603.             ("DEVS:MountList")
  604.             ("DEVS:MountList.old")
  605.             (prompt "Renaming original DEVS:MountList...")
  606.             (help "Your original MountList will be renamed to \"MountList.old\" with your friendly permission...")
  607.          )
  608.          (textfile
  609.             (prompt "Adding entry to DEVS:MountList...")
  610.             (dest "DEVS:MountList")
  611.             (include "DEVS:MountList.old")
  612.             (append "KMSAUX:")
  613.             (include "Devs/DosDrivers/KMSAUX")
  614.             (append "#")
  615.             (help
  616.                "Why can't you simply let me do my work, eh? :-] "
  617.                "You seem to be very curious but anyhow why shouldn't I tell you: "
  618.                "I'm adding an entry for KMSAUX: to your DEVS:MountList..."
  619.             )
  620.          )
  621.          )
  622.       )
  623.       (copylib
  624.          (prompt "Copying KMSAUX-Handler...")
  625.          (source "l/KMSAUX-Handler")
  626.          (dest "L:")
  627.          (help
  628.             "KMSAUX needs this handler to be copied to your \"L:\" directory.\n"
  629.             "\n"
  630.             @copylib-help
  631.          )
  632.       )
  633.       (if
  634.          (NOT (exists "DEVS:DosDrivers" (noreq)))
  635.          (startup "KMSAUX"
  636.             (prompt "Adding \"Mount KMSAUX:\" statement to your user-startup...")
  637.             (command "Mount KMSAUX:")
  638.             (help
  639.                "You will need to execute this statement before being able to use "
  640.                "the KMSAUX: device.\n"
  641.                "\n"
  642.                @startup-help
  643.             )
  644.          )
  645.       )
  646.       )
  647.    )
  648.  
  649.    (complete 95)
  650.  
  651.    (if
  652.       (< oldkmsrev 90)
  653.  
  654.       ; Special messages when updating from before KMS 1.90b
  655.       
  656.       (
  657.       (message
  658.          "\n"
  659.          "Please add the local variables \"KMS.xprcmdreceive\" and \"KMS.xprcmdsend\" "
  660.          "to the KMS user entry in your \"ums.config\".\n"
  661.       )
  662.       (message
  663.          "\nIf you want to use the included XPR-Tool KMSXPR for binary transfers, "
  664.          "these entries have to be defined as follows:\n\n"
  665.          "KMS.xprcmdreceive = \"KMS:Bin/KMSXPR %v OPTIONS *\"%w*\" RECEIVE LOGDIR T: DEFDIR %o %x\"\n"
  666.          "KMS.xprcmdsend    = \"KMS:Bin/KMSXPR %v OPTIONS *\"%w*\" SEND LOGDIR T: %x\"\n\n"
  667.          "(You may copy these lines from Doc/KMS_UMS.config...)"
  668.       )
  669.       )
  670.    )
  671.  
  672.    (message
  673.       "\nUpdate complete.\n"
  674.       "\n"
  675.       "There's just one thing left to do for you:\n"
  676.       "\n"
  677.       "Please move the files \"KMS_SYSMSG.DAT\" and \"KMS_QUOTES.DAT\" "
  678.       "from directory \"KMS.datdir\" to directory \"KMS.txtdir\" and rename "
  679.       "them to \"KMS_SYSTEM.TXT\" and \"KMS_QUOTES.TXT\" respectively.\n"
  680.    )
  681.  
  682.    (complete 100)
  683.    
  684.    (exit)
  685.    )
  686. )
  687.  
  688. ; **************************************************************************
  689. ; update = 2 : Remove KMS Installation
  690. ; **************************************************************************
  691.  
  692. (if (= update 2)
  693.    (
  694.    (if
  695.       (NOT (exists "KMS:" (noreq)))
  696.       (exit (quiet))
  697.    )
  698.    (if 
  699.       (NOT
  700.          (askbool
  701.             (prompt
  702.                "This will delete the complete \"KMS:\" directory!\n"
  703.                "\n"
  704.                "Do you *really* want to do that?"
  705.             )
  706.             (help "Do you?")
  707.          )
  708.       )
  709.       (exit (quiet))
  710.    )
  711.  
  712.    (complete 10)
  713.  
  714.    (makeassign "TempKMS" "KMS:/")
  715.    (makeassign "KMS")
  716.  
  717.    (working "Deleting KMS: directory...")
  718.  
  719.    (run "Delete >NIL: TempKMS:KMS ALL QUIET FORCE")
  720.    (run "Delete >NIL: TempKMS:KMS.info QUIET FORCE")
  721.    
  722.    (makeassign "TempKMS")
  723.  
  724.    (complete 90)
  725.  
  726.    (startup "KMS"
  727.       (prompt "Removing \"KMS:\" Assignment statement from user-startup...")
  728.       (command "; (removed)")
  729.       (help "You *must* have this done, if you've got such a statement in there!")   
  730.    )
  731.  
  732.    (complete 100)
  733.  
  734.    (message
  735.       "\nAll done. Now you got rid of KMS...\n"
  736.       "\n"
  737.       "I hardly hope that you deinstalled KMS only to install it again lateron :-]"
  738.    )
  739.  
  740.    (exit (quiet))
  741.    )
  742. )
  743.  
  744.